from bs4 import BeautifulSoup
import requests

resp = requests.get('https://www.baidu.com')
print(resp.encoding) # ISO-8859-1

resp.encoding = 'utf8'
html = resp.text

soup = BeautifulSoup(html,features="lxml")

title = soup.title.text
print(title)